home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / dev / misc / VSort.lha / vsort.h < prev    next >
C/C++ Source or Header  |  1995-04-19  |  3KB  |  94 lines

  1. /******************************************************************************
  2. **                                                                           **
  3. ** VSort V 1.0                                                               **
  4. **                                                                           **
  5. *******************************************************************************
  6. ** Visualisierung von Sortierprozessen                                       **
  7. ** by Stefan Kost                                                            **
  8. ** 19.04.1995                                                                **
  9. ******************************************************************************/
  10.  
  11. #include "demo.h"
  12. #include <exec/types.h>
  13. #include <dos/dostags.h>
  14. #include <libraries/asl.h>
  15. #include <math.h>
  16. #ifdef _M68881
  17.     #include <m68881.h>
  18. #endif
  19.  
  20. #include <proto/asl.h>
  21.  
  22. //                             ID`s für main_win
  23. #define ID_GO         1
  24. #define ID_EXIT         2
  25. #define ID_ABOUT     3
  26.  
  27. #define    ID_SORTTYP    10
  28. #define ID_DATATYP    11
  29. #define ID_SWAPCT    12
  30. #define ID_ANZ        13
  31. #define ID_DELAY    14
  32.  
  33. //                             ID`s für Cycle`s
  34. #define ST_BUBBLE            0
  35. #define ST_SELECTION        1
  36. #define ST_INSERTION        2
  37. #define ST_SHELL            3
  38. #define ST_QUICK            4
  39. #define ST_MERGE            5
  40. #define ST_RADIXEXCHANGE    6
  41. #define ST_HEAP                7
  42.  
  43. #define DT_SORTED        0
  44. #define DT_MERGED        1
  45. #define    DT_REVERSED        2
  46. #define    DT_REVMERGED    3
  47.  
  48. //                             other defines
  49. #define maxanz 500
  50.  
  51. // GUI-Globals 
  52.  
  53. extern struct DosLibrary    *DOSBase;
  54. struct Screen                *scr=0l;
  55. struct Window                *gfxwin=0l;
  56. struct RastPort                rp;
  57. char *sorttyp[]={    "BubbleSort",
  58.                     "SelectionSort",
  59.                     "InsertionSort",
  60.                     "ShellSort",
  61.                     "QuickSort",
  62.                     "MergeSort",
  63.                     "RadixExchangeSort",
  64.                     "HeapSort",
  65.                     NULL };
  66. char *datatyp[]={    "sorted",
  67.                     "merged",
  68.                     "reversed",
  69.                     "rev + merged",
  70.                     NULL };
  71. char *mess[]={
  72.     "\033c\0338VisualSort V1.0\0332\033n\n\nwritten by ENSONIC of TRINOMIC\nVisualising of sortingprocesses.",
  73. };
  74. char *ques[]={
  75.     "\033cDo you really want to leave \033bVisualSort\033n ?",
  76. };
  77.  
  78. APTR    app1,
  79.         main_win,
  80.             main_go,main_exit,main_about,
  81.             main_sorttyp,main_datatyp,main_swapct,main_anz,main_delay;
  82.  
  83. struct TagItem wintags[]={
  84.     WA_Left,                50,
  85.     WA_Top,                    20,
  86.     WA_InnerWidth,            200,
  87.     WA_InnerHeight,            70,
  88.     WA_IDCMP,                IDCMP_CLOSEWINDOW|IDCMP_RAWKEY,
  89.     WA_Flags,                WFLG_SMART_REFRESH|WFLG_ACTIVATE|WFLG_CLOSEGADGET|WFLG_DRAGBAR|WFLG_DEPTHGADGET|WFLG_GIMMEZEROZERO|WFLG_RMBTRAP,
  90.     WA_Title,                (ULONG *)"VisualSort GFXWindow",
  91.     WA_CustomScreen,        0l,
  92.     TAG_DONE
  93. };
  94.